package com.syg.validation.domain;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * @author syg
 */
@Data
public class User {

    private Long userId;

    @NotNull
    @Length(min = 2, max = 10)
    private String userName;

    @NotNull
    @Length(min = 6, max = 20)
    private String account;

    @NotNull
    @Length(min = 6, max = 20)
    private String password;

    public User() {
    }

    public User(Long userId, String userName, String account, String password) {
        this.userId = userId;
        this.userName = userName;
        this.account = account;
        this.password = password;
    }
}
